home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktimeintro / wiredsprites / common files / macframework.h < prev    next >
Encoding:
Text File  |  2000-10-06  |  2.8 KB  |  137 lines

  1. //////////
  2. //
  3. //
  4. //    File:        MacFramework.h
  5. //
  6. //    Contains:    Basic functions for windows, menus, and similar things.
  7. //
  8. //    Written by:    Tim Monroe
  9. //
  10. //    Copyright:    © 1999 by Apple Computer, Inc., all rights reserved.
  11. //
  12. //    Change History (most recent first):
  13. //       
  14. //       <1>         11/05/99    rtm        first file
  15. //       
  16. //////////
  17.  
  18. #pragma once
  19.  
  20.  
  21. //////////
  22. //       
  23. // header files
  24. //       
  25. //////////
  26.  
  27. #ifndef __APPLEEVENTS__
  28. #include <AppleEvents.h>
  29. #endif
  30.  
  31. #ifndef __CONTROLDEFINITIONS__
  32. #include <ControlDefinitions.h>
  33. #endif
  34.  
  35. #ifndef __CONTROLS__
  36. #include <Controls.h>
  37. #endif
  38.  
  39. #ifndef __DEVICES__
  40. #include <Devices.h>
  41. #endif
  42.  
  43. #ifndef __DIALOGS__
  44. #include <Dialogs.h>
  45. #endif
  46.  
  47. #ifndef __DISKINIT__
  48. #include <DiskInit.h>
  49. #endif
  50.  
  51. #ifndef __FIXMATH__
  52. #include <FixMath.h>
  53. #endif
  54.  
  55. #ifndef __FONTS__
  56. #include <Fonts.h>
  57. #endif
  58.  
  59. #ifndef __MACMEMORY__
  60. #include <MacMemory.h>
  61. #endif
  62.  
  63. #ifndef __MENUS__
  64. #include <Menus.h>
  65. #endif
  66.  
  67. #ifndef __PROCESSES__
  68. #include <Processes.h>
  69. #endif
  70.  
  71. #ifndef __QUICKTIMECOMPONENTS__
  72. #include <QuickTimeComponents.h>
  73. #endif
  74.  
  75. #ifndef __SEGLOAD__
  76. #include <SegLoad.h>
  77. #endif
  78.  
  79. #ifndef __TOOLUTILS__
  80. #include <ToolUtils.h>
  81. #endif
  82.  
  83. #ifndef __TRAPS__
  84. #include <Traps.h>
  85. #endif
  86.  
  87. #ifndef _STDIO_H
  88. #include <stdio.h>
  89. #endif
  90.  
  91. #ifndef _STRING_H
  92. #include <string.h>
  93. #endif
  94.  
  95. #include "ComFramework.h"
  96.  
  97.  
  98. //////////
  99. //
  100. // constants
  101. //
  102. //////////
  103.  
  104. #define kEmergencyMemorySize        40*1024L        // size of the block of memory used for our grow zone procedure
  105. #define kExtraStackSpaceSize        32*1024L        // amount of additional stack space
  106. #define kWNEDefaultSleep            0                // WaitNextEvent sleep time
  107. #define kBroughtToFront                3                // number of times to call EventAvail at application startup
  108.  
  109. // resource IDs for dialogs
  110. #define kAboutBoxID                    128                // dialog ID for About box
  111. #define kAlertErrorID                129                // dialog ID for warning box
  112.  
  113. // resource ID for string resource containing application's name
  114. #define kAppNameResID                1000
  115. #define kAppNameResIndex            1
  116.  
  117. #define kDefaultWindowTitle            "\puntitled"            
  118. #define kDefaultWindowRect            {10,10,480,640}            
  119.  
  120.  
  121. //////////
  122. //
  123. // function prototypes
  124. //       
  125. //////////
  126.  
  127. static void                    QTFrame_InitMacEnvironment (long theNumMoreMasters);
  128. pascal long                    QTFrame_GrowZoneProcedure (Size theBytesNeeded);
  129. static Boolean                 QTFrame_InitMenuBar (void);
  130. static void                 QTFrame_MainEventLoop (void);
  131. void                        QTFrame_HandleEvent (EventRecord *theEvent);
  132. void                         QTFrame_HandleMenuCommand (long theMenuResult);
  133. void                         QTFrame_HandleKeyPress (EventRecord *theEvent);
  134. PASCAL_RTN void                QTFrame_StandardUserItemProcedure (DialogPtr theDialog, short theItem);
  135. PASCAL_RTN Boolean            QTFrame_StandardModalDialogEventFilter (DialogPtr theDialog, EventRecord *theEvent, short *theItemHit);
  136. static Boolean                QTFrame_CheckMovieControllers (EventRecord *theEvent);
  137. void                         QTFrame_ShowWarning (Str255 theMessage, OSErr theErr);